﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BasePanel<T> : MonoBehaviour where T:class
{
    private static T instance;
    public static T Instance => instance;
    private void Awake()
    {
        //为什么要在Awake中赋值?
        //面板脚本在场景中 只会挂载一次，那么我们可以在这个脚本的生命周期函数的Awake中赋值即可
        instance = this as T;
    }
    public virtual void Show()
    {
        this.gameObject.SetActive(true);
    }
    public virtual void Hide()
    {
        this.gameObject.SetActive(false);
    }
}
